const router = require('koa-router')();

const { xnxi } = require('../model/xnxi');

router.post('/xbxi', async (ctx, next) => {
  ctx.body = 'koa2 string';
});

router.post('/xnxi', async (ctx, next) => {
  const res = await xnxi.find();
  console.log('我是用来进行获取xnxi的数据的', res);
  ctx.body = {
    code: 200,
    msg: '成功获取数据',
    data: res,
  };
});

module.exports = router;
